﻿using System;

namespace Citi.ExpenseReport.WebUI.Models
{
    public class FeedModel
    {
        public int Id { get; set; }
        public string SoeId { get; set; }
        public int SubServiceId { get; set; }
        public decimal Amount { get; set; }
        public DateTime Date { get; set; }
        public decimal UnitValue { get; set; }
        public string Details { get; set; }

        public static FeedModel CreateViewModel(Domain.Feed domain)
        {
            return new FeedModel
            {
                Amount = domain.Amount,
                Date = domain.Date,
                Details = domain.Details,
                Id = domain.Id,
                SoeId = domain.Employee.SoeId,
                SubServiceId = domain.SubServiceId,
                UnitValue = domain.UnitCost
            };
        }
    }
}